package dbAccess;

import org.apache.commons.dbcp.BasicDataSource;

public class DbAccessSessionFactory {

	
	private static BasicDataSource ds;
	
	
	
	
	@SuppressWarnings("unused")
	private DbAccessSessionFactory(){
		
	}
	public DbAccessSessionFactory(String driverName, String userName, String password, String url) {
	
		ds = new BasicDataSource();
		ds.setDriverClassName(driverName);
		ds.setUsername(userName);
		ds.setPassword(password);
		ds.setUrl(url);
		ds.setInitialSize(4);
	}
	
	
	public DbAccessSession getDbAccessSession(){
		
		
	     	DbAccessSession dbAccessSession = new DbAccessSession(ds);
	     	return dbAccessSession;
		
		
		
	}
	
	
	
	
	

	
}
